//  receiver server.
//  SI4432 Wireless Module receiver server Variable Resistor RGB //  sketch.
//  SI4432 Wireless Module transmitter client Variable Resistor RGB //  sketch. https://yadi.sk/d/yF_fwOrUZFjLm
//     SI4432 Wireless Module 433mhz Transmitter Receiver Arduino
// https://www.youtube.com/watch?v=wPhbWEMBIsw&list=UU7aH7HVqDvwB1xNHfSl-fDw
#include <SPI.h>
#include <RH_RF22.h> //  , RadioHead https://yadi.sk/d/Impr0nuNWY2Zq
RH_RF22 rf22; // Singleton instance of the radio driver.
int ledPin = 3; // .
void setup() 
{ 
  Serial.begin(9600);
  rf22.init();
  pinMode(ledPin, OUTPUT); 
}
void loop()
{
  if (rf22.available() > 0){ //   .
    uint8_t buf[RH_RF22_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
    if (rf22.recv(buf, &len))analogWrite(ledPin, *buf); //   . 
    Serial.println(*buf);
  }
}



